home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / scgzfile.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-10-30  |  1.4 KB  |  53 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7.  
  8. #ifndef SCGZFILE_H
  9. #define SCGZFILE_H
  10.  
  11. #include <QByteArray>
  12. #include <QIODevice>
  13. #include <QString>
  14.  
  15. #include "scribusapi.h"
  16.  
  17. struct ScGzFileDataPrivate;
  18.  
  19. class SCRIBUS_API ScGzFile : public QIODevice
  20. {
  21. protected:
  22.     QString              m_fileName;
  23.     ScGzFileDataPrivate* m_data;
  24.     ScGzFileDataPrivate* newPrivateData(void);
  25.     void freeData(void);
  26.  
  27.     bool    gzFileOpen(QString fileName, ScGzFileDataPrivate* data, QIODevice::OpenMode mode);
  28.     
  29.     virtual qint64 readData  (char * data, qint64 maxSize);
  30.     virtual qint64 writeData (const char * data, qint64 maxSize);
  31.  
  32. public:
  33.     ScGzFile(const QString& filename);
  34.     ~ScGzFile(void);
  35.  
  36.     static const int gzipExpansionFactor;
  37.     
  38.     virtual bool atEnd() const;
  39.     virtual bool open(QIODevice::OpenMode mode);
  40.     virtual void close();
  41.  
  42.     bool errorOccurred(void) const;
  43.     int  error(void) const;
  44.  
  45.     bool reset(void);
  46.  
  47.     static bool readFromFile(const QString& filename, QByteArray& bArray, uint maxBytes = 0);
  48.     static bool writeToFile (const QString& filename, const QByteArray& bArray);
  49.     static bool writeToFile (const QString& filename, const QByteArray& bArray, const char* header);
  50. };
  51.  
  52. #endif
  53.